/*  Copyright © 2009 Blake Hegerle -*- C++ -*- */

/*  This file is part of metal.
 
    Metal is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see
    <http://www.gnu.org/licenses/>.

*/

#include "metal.h"
#include "io.h"

using namespace std;
using namespace metal;
using namespace metal::meta;

/* void closure_tests() {
  cout << "closure_tests" << endl;

  auto x = new ident_expr_impl("x");
  auto dot = dot_expr_impl(expr_ptr(x), "y");
  auto ident = ident_expr_impl("a");
  auto f = new ident_expr_impl("f");

  initializer_list<expr_ptr> args = { expr_ptr(f), cnst_impl(0) };
  auto call = call_expr_impl(args.begin(), args.end());

  assert(!dot.is_ident());
  assert(ident.is_ident());
  assert(!call.is_ident());
  }*/

void lambda_tests() {
  cout << "lambda_tests" << endl;

  lambda_placeholder<int> lph = lambda<int>();

  typedef lambda_expr<int, constant_expr<int> > meta_expr;
  expression<meta_expr> le = lph( 0 );

  auto impl = le.impl();
  cout << *impl << endl;

  impl = imbue_type<meta_expr, bindings<> >(impl);
  cout << *impl << endl;
}
